// 2013-9-26下午02:26:06  net.betou.trade.share.TemplateAbstract.java

package net.betou.trade.share;

import java.util.List;

import net.betou.common.page.Pagination;
import net.betou.trade.entity.main.AgentAndAdmins;
import net.betou.trade.main.manager.ShareMng;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;

/**
 * 
 * @author 叶装装
 */
public class TemplateAbstract implements Template{

	public void afterPage( ModelMap model ) {
	}

	public void setPage( ModelMap model, AgentAndAdmins admin, Integer pageSize, Integer pageNo, String searchProperty, String searchValue, String orderProperty, String orderDirection, String filterStatus ) {
	}
	
	@SuppressWarnings( "unchecked" )
	protected void paramToModel( ModelMap model, Pagination p, List list, Integer pageSize, String searchProperty, String searchValue, String orderProperty, String orderDirection, String filterStatus ) {
		model.addAttribute( "pageSize", pageSize );
		model.addAttribute( "orderDirection", orderDirection );
		model.addAttribute( "orderProperty", orderProperty );
		model.addAttribute( "searchProperty", searchProperty );
		model.addAttribute( "searchValue", searchValue );
		model.addAttribute( "filterStatus", filterStatus );
		if( list != null ){
			model.addAttribute( "count", list == null ? 0 : list.size( ) );
			model.addAttribute( "list", list );
		}

		if( p != null ){
			model.addAttribute( "pagination", p );
		}
	}
	
	@Autowired
	protected ShareMng mng;

}
